package com.carlinfo.shop.common.util;

import org.apache.logging.log4j.LogManager;
import org.apache.logging.log4j.Logger;

import com.alibaba.fastjson.JSON;
import com.alibaba.fastjson.JSONObject;

public class ConstatFinalUtil
{
	public static final Logger LOGGER = LogManager.getLogger();

	public static final String CHARSET = "UTF-8";

	public static JSONObject CONFIG_JSON = new JSONObject();

	public static JSONObject INFO_JSON = new JSONObject();

	static
	{
		try
		{
			FileUtil fileUtil = new FileUtil();
			String result = fileUtil
					.readFile(ConstatFinalUtil.class.getClassLoader().getResourceAsStream("config.json"));

			CONFIG_JSON = (JSONObject) JSON.parse(result);
			INFO_JSON = CONFIG_JSON.getJSONObject("info");
		} catch (Exception e)
		{
			ConstatFinalUtil.LOGGER.error("解析配置文件出异常了;", e);
		}

	}
}
